function columns(vm) {
  const cols = [
    {
      title: '序号',
      key: 'rowIndex',
      width: 60,
      align: 'center',
      customRender: function (text, row, index) {
        if (row.totalName == '合计') {
          return {
            children: vm.transformVnode('合计'),
            attrs: {
              colSpan: 2,
            },
          }
        } else {
          return Number(row.xu)
        }
      }
    },
    {
      title: '项目',
      align: 'center',
      dataIndex: 'xm',
      key: 'xm',
      customRender: function (text, row, index) {
        if (row.totalName == '合计') {
          return {
            attrs: {
              colSpan: 0,
            },
          }
        } else
          return {
            children: vm.TransformVnodeEllipsis(text, row, 'xm')
          }
      }
    },
    {
      title: '实际发生成本',
      align: 'right',
      dataIndex: 'sjfscb',
      key: 'sjfscb',
      scopedSlots: { customRender: 'sjfscb' },
    },
    {
      title: '合同外变更索赔资料签证（签√，未签×）',
      align: 'center',
      children: [
        {
          title: '未计价金额',
          align: 'right',
          dataIndex: 'wjjje',
          key: 'wjjje',
          scopedSlots: { customRender: 'wjjje' },
        },
        {
          title: '监理单位',
          align: 'center',
          dataIndex: 'jldw',
          key: 'ajldw4',
          scopedSlots: { customRender: 'jldw' },
        },
        {
          title: '设计单位',
          align: 'center',
          dataIndex: 'sjdw',
          key: 'sjdw',
          scopedSlots: { customRender: 'sjdw' },
        },
        {
          title: '建设单位',
          align: 'center',
          dataIndex: 'jsdw',
          key: 'jsdw',
          scopedSlots: { customRender: 'jsdw' },
        },
      ]
    },
    {
      title: '未计价部分确认收入情况',
      align: 'center',
      children: [
        {
          title: '确认金额',
          align: 'right',
          dataIndex: 'qrje',
          key: 'qrje',
          scopedSlots: { customRender: 'qrje' },
        },
        {
          title: '确认比例',
          align: 'right',
          dataIndex: 'qrbl',
          key: 'qrbl',
          scopedSlots: { customRender: 'qrbl' },
        },
      ]
    },
    {
      title: '核实应确认收入情况',
      align: 'center',
      children: [
        {
          title: '核实金额',
          align: 'right',
          dataIndex: 'hsje',
          key: 'hsje',
          scopedSlots: { customRender: 'hsje' },
        },
        {
          title: '核实比例',
          align: 'right',
          dataIndex: 'hsbl',
          key: 'hsbl',
          scopedSlots: { customRender: 'hsbl' },
        },
      ]
    },
    {
      dataIndex: 'action',
      align: 'center',
      title: "操作",
      scopedSlots: { customRender: 'action' },
      key: 'action',
      width: 100,
      fixed: 'right',
    }
  ]
  return cols
}

export default columns